<script setup lang="ts">
import type { OrganizationVO } from '@/api/Organization.ts'

const props = defineProps<{
  organization: OrganizationVO
}>()

defineEmits<{
  (e: 'close'): void
}>()

const formatDate = (dateStr: string) => {
  if (!dateStr) return '-'
  const date = new Date(dateStr)
  return date.toLocaleDateString('zh-CN', {
    year: 'numeric',
    month: '2-digit',
    day: '2-digit',
    hour: '2-digit',
    minute: '2-digit'
  })
}
</script>

<template>
<a-descriptions bordered size="small" :column="1">
  <a-descriptions-item label="ID">{{ props.organization.id }}</a-descriptions-item>
  <a-descriptions-item label="组织名称">{{ props.organization.name }}</a-descriptions-item>
  <a-descriptions-item label="描述">{{ props.organization.description || '暂无' }}</a-descriptions-item>
  <a-descriptions-item label="创建者ID">{{ props.organization.creatorId }}</a-descriptions-item>
  <a-descriptions-item label="当前成员数">{{ props.organization.currentMembers }}</a-descriptions-item>
  <a-descriptions-item label="创建时间">{{ formatDate(props.organization.createTime) }}</a-descriptions-item>
  <a-descriptions-item label="更新时间">{{ formatDate(props.organization.updateTime) }}</a-descriptions-item>
</a-descriptions>
</template>

<style scoped>

</style>

